<!DOCTYPE html><html><head><title>README</title><link href="http://www.jboss.org/jdf/stylesheets/documentation.css" rel="stylesheet"></link><link href="http://www.jboss.org/jdf/stylesheets/pygments.css" rel="stylesheet"></link></head><body>
<h1><a id="red-hat-jboss-enterprise-application-platform-eap-quickstarts" class="anchor" href="#red-hat-jboss-enterprise-application-platform-eap-quickstarts"><span class="anchor-icon"></span></a>Red Hat JBoss Enterprise Application Platform (EAP) Quickstarts</h1>

<p>Summary: The quickstarts demonstrate Java EE 6 and a few additional technologies from the JBoss stack. They provide small, specific, working examples that can be used as a reference for your own project.</p>

<h2><a id="introduction" class="anchor" href="#introduction"><span class="anchor-icon"></span></a>Introduction</h2>

<p>These quickstarts run on Red Hat JBoss Enterprise Application Platform 6.1 or later. We recommend using the JBoss EAP ZIP file. This version uses the correct dependencies and ensures you test and compile against your runtime environment. </p>

<p>Be sure to read this entire document before you attempt to work with the quickstarts. It contains the following information:</p>

<ul>
<li><p><a href="#available-quickstarts">Available Quickstarts</a>: List of the available quickstarts and details about each one.</p></li>
<li><p><a href="#suggested-approach-to-the-quickstarts">Suggested Approach to the Quickstarts</a>: A suggested approach on how to work with the quickstarts.</p></li>
<li><p><a href="#system-requirements">System Requirements</a>: List of software required to run the quickstarts.</p></li>
<li><p><a href="#configure-maven">Configure Maven</a>: How to configure the Maven repository for use by the quickstarts.</p></li>
<li><p><a href="#run-the-quickstarts">Run the Quickstarts</a>: General instructions for building, deploying, and running the quickstarts.</p></li>
<li><p><a href="#run-the-arquillian-tests">Run the Arquillian Tests</a>: How to run the Arquillian tests provided by some of the quickstarts.</p></li>
<li><p><a href="#optional-components">Optional Components</a>: How to install and configure optional components required by some of the quickstarts.</p></li>
</ul>

<h2><a id="available-quickstarts" class="anchor" href="#available-quickstarts"><span class="anchor-icon"></span></a>Available Quickstarts</h2>

<p>The list of all currently available quickstarts can be found here: <a href="http://site-jdf.rhcloud.com/quickstarts/get-started/">http://site-jdf.rhcloud.com/quickstarts/get-started/</a>. The table lists each quickstart name, the technologies it demonstrates, gives a brief description of the quickstart, and the level of experience required to set it up. For more detailed information about a quickstart, click on the quickstart name.</p>

<p>Some quickstarts are designed to enhance or extend other quickstarts. These are noted in the <strong>Prerequisites</strong> column. If a quickstart lists prerequisites, those must be installed or deployed before working with the quickstart.</p>

<p>Quickstarts with tutorials in the <a href="http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/guide/Introduction/" title="Get Started Developing Applications">Get Started Developing Applications</a> are noted with two asterisks ( ** ) following the quickstart name. </p>

<p><em>Note: Some of these quickstart use the H2 database included with JBoss EAP 6. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable and should NOT be used in a production environment!</em></p>

<table><thead><tr><th align='left'><strong>Quickstart Name</strong></th><th align='left'><strong>Demonstrated Technologies</strong></th><th align='left'><strong>Description</strong></th><th align='left'><strong>Experience Level Required</strong></th><th align='left'><strong>Prerequisites</strong></th></tr></thead><tbody><tr><td align='left'><a href='bean-validation/README.html' title='bean-validation'>bean-validation</td><td align='left'>  JPA, Bean Validation</td><td align='left'>Shows how to use Arquillian to test Bean Validation</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='bmt/README.html' title='bmt'>bmt</td><td align='left'>  Bean Managed Transactions (BMT), EJB</td><td align='left'>EJB that demonstrates bean-managed transactions (BMT)</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='cdi-alternative/README.html' title='cdi-alternative'>cdi-alternative</td><td align='left'>  JSP,  Servlet, CDI</td><td align='left'>Demonstrates the use of CDI Alternatives where the bean is selected during deployment</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='cdi-decorator/README.html' title='cdi-decorator'>cdi-decorator</td><td align='left'> CDI</td><td align='left'>Demonstrates the use of CDI Decorator where the bean is can be decorated.</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='cdi-injection/README.html' title='cdi-injection'>cdi-injection</td><td align='left'> CDI</td><td align='left'>Demonstrates the use of CDI 1.0 Injection and Qualifiers with JSF as the front-end client.</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='cdi-interceptors/README.html' title='cdi-interceptors'>cdi-interceptors</td><td align='left'> EJB, JPA, JSF</td><td align='left'>Demonstrates using cdi-interceptors for logging and auditing</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='cdi-portable-extension/README.html' title='cdi-portable-extension'>cdi-portable-extension</td><td align='left'> CDI</td><td align='left'>Creating a basic CDI extension to provide injection of fields from an XML file.</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='cdi-stereotype/README.html' title='cdi-stereotype'>cdi-stereotype</td><td align='left'> EJB, JPA, JSF</td><td align='left'>Demonstrates using cdi-stereotype for logging and auditing</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='cdi-veto/README.html' title='cdi-veto'>cdi-veto</td><td align='left'> CDI</td><td align='left'>Creating a basic CDI extension to demonstrate vetoing beans.</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='cluster-ha-singleton/README.html' title='cluster-ha-singleton'>cluster-ha-singleton</td><td align='left'>  HASingleton,  JNDI, EJB</td><td align='left'>A SingletonService deployed in a JAR started by SingletonStartup and accessed by an EJB</td><td align='left'>Advanced</td><td align='left'> </td></tr>
<tr><td align='left'><a href='cmt/README.html' title='cmt'>cmt</td><td align='left'>  Container Managed Transactions (CMT), EJB</td><td align='left'>EJB that demonstrates container-managed transactions (CMT)</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-asynchronous/README.html' title='ejb-asynchronous'>ejb-asynchronous</td><td align='left'> EJB</td><td align='left'>Demonstrates asynchronous EJB invocations.</td><td align='left'>Advanced</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-in-ear/README.html' title='ejb-in-ear'>ejb-in-ear</td><td align='left'>  EAR, EJB</td><td align='left'>Packages an EJB JAR and WAR in an EAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-in-war/README.html' title='ejb-in-war'>ejb-in-war</td><td align='left'>  JSF,  WAR, EJB</td><td align='left'>Packages an EJB JAR in a WAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-multi-server/README.html' title='ejb-multi-server'>ejb-multi-server</td><td align='left'>  EAR, EJB</td><td align='left'>EJB applications deployed to different servers that communicate via EJB remote calls</td><td align='left'>Advanced</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-remote/README.html' title='ejb-remote'>ejb-remote</td><td align='left'> EJB</td><td align='left'>Shows how to access an EJB from a remote Java client program using JNDI</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-security/README.html' title='ejb-security'>ejb-security</td><td align='left'>  Security, EJB</td><td align='left'>Shows how to use Java EE Declarative Security to Control Access to EJB 3</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-security-interceptors/README.html' title='ejb-security-interceptors'>ejb-security-interceptors</td><td align='left'>  Security, EJB</td><td align='left'>Demonstrates how interceptors can be used to switch the identity for EJB calls on a call by call basis.</td><td align='left'>Advanced</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-throws-exception/README.html' title='ejb-throws-exception'>ejb-throws-exception</td><td align='left'>  EAR, EJB</td><td align='left'>Shows how to handle Exceptions across JARs in an EAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='ejb-timer/README.html' title='ejb-timer'>ejb-timer</td><td align='left'> EJB 3.1 Timer</td><td align='left'>Demonstrates how to use EJB 3.1 Timer (@Schedule and @Timeout) with the JBoss AS server.</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='forge-from-scratch/README.html' title='forge-from-scratch'>forge-from-scratch</td><td align='left'> Forge</td><td align='left'>Demonstrates how to generate a fully Java EE compliant project using nothing but JBoss Forge</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='greeter/README.html' title='greeter'>greeter</td><td align='left'>  EJB,  JPA,  JSF,  JTA, CDI</td><td align='left'>Demonstrates the use of CDI 1.0, JPA 2.0, JTA 1.1, EJB 3.1 and JSF 2.0</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='h2-console/README.html' title='h2-console'>h2-console</td><td align='left'> H2</td><td align='left'>Shows how to use the H2 console with JBoss AS</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='helloworld/README.html' title='helloworld'>helloworld</td><td align='left'>  Servlet, CDI</td><td align='left'>Basic example that can be used to verify that the server is configured and running correctly</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='helloworld-jms/README.html' title='helloworld-jms'>helloworld-jms</td><td align='left'> JMS</td><td align='left'>Demonstrates the use of a standalone (Java SE) JMS client</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='helloworld-mbean/README.html' title='helloworld-mbean'>helloworld-mbean</td><td align='left'>  JMX and MBean, CDI</td><td align='left'>Demonstrates the use of CDI 1.0 and MBean</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='helloworld-mdb/README.html' title='helloworld-mdb'>helloworld-mdb</td><td align='left'>  EJB,  MDB, JMS</td><td align='left'>Demonstrates the use of JMS 1.1 and EJB 3.1 Message-Driven Bean</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='helloworld-osgi/README.html' title='helloworld-osgi'>helloworld-osgi</td><td align='left'> OSGi</td><td align='left'>Shows how to create and deploy a simple OSGi Bundle</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='helloworld-rs/README.html' title='helloworld-rs'>helloworld-rs</td><td align='left'>  JAX-RS, CDI</td><td align='left'>Demonstrates the use of CDI 1.0 and JAX-RS</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='helloworld-singleton/README.html' title='helloworld-singleton'>helloworld-singleton</td><td align='left'>  Singleton, EJB</td><td align='left'>Demonstrates the use of an EJB 3.1 Singleton Session Bean, instantiated once, maintaining state for the life of the session</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='helloworld-ws/README.html' title='helloworld-ws'>helloworld-ws</td><td align='left'> JAX-WS</td><td align='left'>Deployment of a basic JAX-WS Web service bundled in a WAR archive</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='hibernate3/README.html' title='hibernate3'>hibernate3</td><td align='left'> Hibernate 3</td><td align='left'>Example that uses Hibernate 3 for database access. Compare the code in this quickstart to the hibernate4 quickstart to see the changes needed to upgrade to Hibernate 4.</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='hibernate4/README.html' title='hibernate4'>hibernate4</td><td align='left'> Hibernate 4</td><td align='left'>This quickstart performs the same functions as the hibernate3 quickstart, but uses Hibernate 4 for database access. Compare this quickstart to the hibernate3 quickstart to see the changes needed to run with Hibernate 4.</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='hornetq-clustering/README.html' title='hornetq-clustering'>hornetq-clustering</td><td align='left'>  HornetQ,  MDB, JMS</td><td align='left'>Demonstrates the use of HornetQ Clustering</td><td align='left'>Intermediate</td><td align='left'> helloworld-mdb</td></tr>
<tr><td align='left'><a href='inter-app/README.html' title='inter-app'>inter-app</td><td align='left'>  CDI,  JSF, EJB</td><td align='left'>Shows how to communicate between two applications using EJB and CDI</td><td align='left'>Advanced</td><td align='left'> </td></tr>
<tr><td align='left'><a href='jax-rs-client/README.html' title='jax-rs-client'>jax-rs-client</td><td align='left'> JAX-RS</td><td align='left'>Demonstrates the use an external JAX-RS RestEasy client which interacts with a JAX-RS Web service that uses CDI 1.0 and JAX-RS</td><td align='left'>Intermediate</td><td align='left'> helloworld-rs</td></tr>
<tr><td align='left'><a href='jta-crash-rec/README.html' title='jta-crash-rec'>jta-crash-rec</td><td align='left'>  Crash Recovery, JTA</td><td align='left'>Uses Java Transaction API and JBoss Transactions to demonstrate recovery of a crashed transaction</td><td align='left'>Advanced</td><td align='left'> </td></tr>
<tr><td align='left'><a href='jts/README.html' title='jts'>jts</td><td align='left'> JTS</td><td align='left'>Uses Java Transaction Service (JTS) to coordinate distributed transactions</td><td align='left'>Intermediate</td><td align='left'> cmt</td></tr>
<tr><td align='left'><a href='jts-distributed-crash-rec/README.html' title='jts-distributed-crash-rec'>jts-distributed-crash-rec</td><td align='left'> JTS</td><td align='left'>Demonstrates recovery of distributed crashed components</td><td align='left'>Advanced</td><td align='left'> jts</td></tr>
<tr><td align='left'><a href='kitchensink/README.html' title='kitchensink'>kitchensink</td><td align='left'>  BV,  EJB,  JAX-RS,  JPA,  JPA,  JSF, CDI</td><td align='left'>An example that incorporates multiple technologies</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='kitchensink-ear/README.html' title='kitchensink-ear'>kitchensink-ear</td><td align='left'> EAR</td><td align='left'>Based on kitchensink, but deployed as an EAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='kitchensink-jsp/README.html' title='kitchensink-jsp'>kitchensink-jsp</td><td align='left'> JSP</td><td align='left'>Based on kitchensink, but uses a JSP for the user interface</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='kitchensink-ml/README.html' title='kitchensink-ml'>kitchensink-ml</td><td align='left'>  BV,  EJB,  JAX-RS,  JPA,  JPA,  JSF, CDI</td><td align='left'>A localized version of kitchensink</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='kitchensink-ml-ear/README.html' title='kitchensink-ml-ear'>kitchensink-ml-ear</td><td align='left'> EAR</td><td align='left'>A localized version of kitchensink-ear</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='log4j/README.html' title='log4j'>log4j</td><td align='left'> JBoss Modules</td><td align='left'>Demonstrates how to use modules to control class loading for 3rd party logging frameworks</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='logging/README.html' title='logging'>logging</td><td align='left'> Logging</td><td align='left'>Demonstrates how to set various application logging levels</td><td align='left'>Intermediate</td><td align='left'> None</td></tr>
<tr><td align='left'><a href='logging-tools/README.html' title='logging-tools'>logging-tools</td><td align='left'> JBoss Logging Tools</td><td align='left'>Demonstrates the use of JBoss Logging Tools to create internationalized loggers, exceptions, and generic messages</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='mail/README.html' title='mail'>mail</td><td align='left'>  CDI,  JSF, JavaMail</td><td align='left'>Demonstrates the use of JavaMail</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='numberguess/README.html' title='numberguess'>numberguess</td><td align='left'>  JSF, CDI</td><td align='left'>Demonstrates the use of CDI 1.0 and JSF 2.0</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='payment-cdi-event/README.html' title='payment-cdi-event'>payment-cdi-event</td><td align='left'> CDI</td><td align='left'>Demonstrates how to use CDI 1.0 Events</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='picketlink-sts/README.html' title='picketlink-sts'>picketlink-sts</td><td align='left'>  SAML, WS-Trust</td><td align='left'>This project is an implementation of a WS-Trust Security Token Service.</td><td align='left'>Advanced</td><td align='left'> </td></tr>
<tr><td align='left'><a href='servlet-async/README.html' title='servlet-async'>servlet-async</td><td align='left'>  CDI,  EJB, Servlet</td><td align='left'>Demonstrates CDI, plus asynchronous Servlets and EJBs</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='servlet-filterlistener/README.html' title='servlet-filterlistener'>servlet-filterlistener</td><td align='left'> Servlet</td><td align='left'>Demonstrates Servlet filters and listeners</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='servlet-security/README.html' title='servlet-security'>servlet-security</td><td align='left'>  Security, Servlet</td><td align='left'>Demonstrates how to use Java EE declarative security to control access to Servlet 3</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='shopping-cart/README.html' title='shopping-cart'>shopping-cart</td><td align='left'> EJB</td><td align='left'>Demonstrates a stateful session bean</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='tasks/README.html' title='tasks'>tasks</td><td align='left'>  Arquillian, JPA</td><td align='left'>Demonstrates testing JPA using Arquillian</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='tasks-jsf/README.html' title='tasks-jsf'>tasks-jsf</td><td align='left'>  JPA, JSF</td><td align='left'>Provides a JSF 2.0 as view layer for the tasks quickstart</td><td align='left'>Intermediate</td><td align='left'> tasks</td></tr>
<tr><td align='left'><a href='tasks-rs/README.html' title='tasks-rs'>tasks-rs</td><td align='left'>  JAX-RS, JPA</td><td align='left'>Demonstrates how to use JAX-RS and JPA together</td><td align='left'>Intermediate</td><td align='left'> tasks</td></tr>
<tr><td align='left'><a href='temperature-converter/README.html' title='temperature-converter'>temperature-converter</td><td align='left'> EJB</td><td align='left'>Demonstrates a stateless session bean</td><td align='left'>Beginner</td><td align='left'> </td></tr>
<tr><td align='left'><a href='wicket-ear/README.html' title='wicket-ear'>wicket-ear</td><td align='left'>  JPA, Apache Wicket</td><td align='left'>Demonstrates how to use the Wicket Framework 1.5 with the JBoss server using the Wicket-Stuff Java EE integration, packaged as an EAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='wicket-war/README.html' title='wicket-war'>wicket-war</td><td align='left'>  JPA, Apache Wicket</td><td align='left'>Demonstrates how to use the Wicket Framework 1.5 with the JBoss server using the Wicket-Stuff Java EE integration packaged as a WAR</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='wsat-simple/README.html' title='wsat-simple'>wsat-simple</td><td align='left'>  JAX-WS, WS-AT</td><td align='left'>Deployment of a WS-AT (WS-AtomicTransaction) enabled JAX-WS Web service bundled in a WAR archive</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='wsba-coordinator-completion-simple/README.html' title='wsba-coordinator-completion-simple'>wsba-coordinator-completion-simple</td><td align='left'>  JAX-WS, WS-BA</td><td align='left'> Deployment of a WS-BA (WS-BusinessActivity) enabled JAX-WS Web service bundled in a WAR archive (Participant Completion protocol)</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='wsba-participant-completion-simple/README.html' title='wsba-participant-completion-simple'>wsba-participant-completion-simple</td><td align='left'>  JAX-WS, WS-BA</td><td align='left'>Deployment of a WS-BA (WS-BusinessActivity) enabled JAX-WS Web service bundled in a war archive (Coordinator Completion protocol)</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='xml-dom4j/README.html' title='xml-dom4j'>xml-dom4j</td><td align='left'>  JSF,  Servlet, DOM4J</td><td align='left'>Demonstrates how to upload an XML file and parse it using 3rd party XML parsing libraries</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
<tr><td align='left'><a href='xml-jaxp/README.html' title='xml-jaxp'>xml-jaxp</td><td align='left'>  DOM,  SAX,  Servlet, JAXP</td><td align='left'>Upload, validation and parsing of XML using SAX or DOM</td><td align='left'>Intermediate</td><td align='left'> </td></tr>
</table></table>

<h2><a id="suggested-approach-to-the-quickstarts" class="anchor" href="#suggested-approach-to-the-quickstarts"><span class="anchor-icon"></span></a>Suggested Approach to the Quickstarts</h2>

<p>We suggest you approach the quickstarts as follows:</p>

<ul>
<li>Regardless of your level of expertise, we suggest you start with the <strong>helloworld</strong> quickstart. It is the simplest example and is an easy way to prove your server is configured and started correctly.</li>
<li>If you are a beginner or new to JBoss, start with the quickstarts labeled <strong>Beginner</strong>, then try those marked as <strong>Intermediate</strong>. When you are comfortable with those, move on to the <strong>Advanced</strong> quickstarts.</li>
<li>Some quickstarts are based upon other quickstarts but have expanded capabilities and functionality. If a prerequisite quickstart is listed, be sure to deploy and test it before looking at the expanded version.</li>
</ul>

<h2><a id="system-requirements" class="anchor" href="#system-requirements"><span class="anchor-icon"></span></a>System Requirements</h2>

<p>The applications these projects produce are designed to be run on Red Hat JBoss Enterprise Application Platform 6.1 or later. </p>

<p>To run these quickstarts with the provided build scripts, you need the following:</p>

<ol>
<li><p>Java 1.6, to run JBoss AS and Maven. You can choose from the following:</p>

<ul>
<li>OpenJDK</li>
<li>Oracle Java SE</li>
<li>Oracle JRockit</li>
</ul></li>
<li><p>Maven 3.0.0 or newer, to build and deploy the examples</p>

<ul>
<li>If you have not yet installed Maven, see the <a href="http://maven.apache.org/guides/getting-started/index.html">Maven Getting Started Guide</a> for details.</li>
<li><p>If you have installed Maven, you can check the version by typing the following in a command line:</p>
<div class="highlight"><pre><span class="n">mvn</span> <span class="o">--</span><span class="n">version</span> 
</pre></div></li>
</ul></li>
<li><p>The JBoss EAP distribution ZIP.</p>

<ul>
<li>For information on how to install and run JBoss, refer to the product documentation.</li>
</ul></li>
<li><p>You can also use <a href="#use-jboss-developer-studio-or-eclipse-to-run-the-quickstarts">JBoss Developer Studio or Eclipse</a> to run the quickstarts. </p></li>
</ol>

<h2><a id="configure-maven" class="anchor" href="#configure-maven"><span class="anchor-icon"></span></a>Configure Maven</h2>

<h3><a id="configure-maven-to-build-and-deploy-the-quickstarts" class="anchor" href="#configure-maven-to-build-and-deploy-the-quickstarts"><span class="anchor-icon"></span></a>Configure Maven to Build and Deploy the Quickstarts</h3>

<p>The quickstarts use artifacts located in the JBoss Developer repository. You must configure Maven to use that repository before you build and deploy the quickstarts. </p>

<p><em>Note: If you do not wish to configure the Maven settings, you must pass the configuration setting on every Maven command as follows: ` -s QUICKSTART</em>HOME/settings.xml`_</p>

<ol>
<li><p>Locate the Maven install directory for your operating system. It is usually installed in <code>${user.home}/.m2/</code>. </p>
<div class="highlight"><pre>    <span class="n">For</span> <span class="n">Linux</span> <span class="n">or</span> <span class="n">Mac</span><span class="o">:</span>   <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span>
    <span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="err">\</span><span class="n">Documents</span> <span class="n">and</span> <span class="n">Settings</span><span class="err">\</span><span class="n">USER_NAME</span><span class="err">\</span><span class="p">.</span><span class="n">m2</span><span class="err">\</span>  <span class="o">-</span><span class="n">or</span><span class="o">-</span>  <span class="err">\</span><span class="n">Users</span><span class="err">\</span><span class="n">USER_NAME</span><span class="err">\</span><span class="p">.</span><span class="n">m2</span>\
</pre></div></li>
<li><p>If you have an existing <code>settings.xml</code> file, rename it so you can restore it later.</p>
<div class="highlight"><pre>    <span class="n">For</span> <span class="n">Linux</span> <span class="n">or</span> <span class="n">Mac</span><span class="o">:</span>  <span class="n">mv</span> <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span> <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span><span class="n">settings</span><span class="o">-</span><span class="n">backup</span><span class="p">.</span><span class="n">xml</span>
    <span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">ren</span> <span class="s">&quot;\Documents and Settings\USER_NAME\.m2\settings.xml&quot;</span> <span class="n">settings</span><span class="o">-</span><span class="n">backup</span><span class="p">.</span><span class="n">xml</span>
            <span class="o">-</span><span class="n">or</span><span class="o">-</span> <span class="n">ren</span> <span class="s">&quot;\Users\USER_NAME\.m2\settings.xml&quot;</span> <span class="n">settings</span><span class="o">-</span><span class="n">backup</span><span class="p">.</span><span class="n">xml</span>
</pre></div></li>
<li><p>If you have an existing <code>repository/</code> directory, rename it so you can restore it later. For example</p>
<div class="highlight"><pre>    <span class="n">For</span> <span class="n">Linux</span> <span class="n">or</span> <span class="n">Mac</span><span class="o">:</span>  <span class="n">mv</span> <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span><span class="n">repository</span><span class="o">/</span> <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span><span class="n">repository</span><span class="o">-</span><span class="n">backup</span><span class="o">/</span>
    <span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">ren</span> <span class="s">&quot;\Documents and Settings\USER_NAME\.m2</span><span class="se">\r</span><span class="s">epository</span><span class="se">\&quot;</span><span class="s"> repository-backup</span>
            <span class="o">-</span><span class="n">or</span><span class="o">-</span> <span class="n">ren</span> <span class="s">&quot;\Users\USER_NAME\.m2</span><span class="se">\r</span><span class="s">epository</span><span class="se">\&quot;</span><span class="s"> repository-backup</span>
</pre></div></li>
<li><p>Copy the <code>settings.xml</code> file from the root of the quickstarts directory to your Maven install directory.</p>
<div class="highlight"><pre>    <span class="n">For</span> <span class="n">Linux</span> <span class="n">or</span> <span class="n">Mac</span><span class="o">:</span>  <span class="n">cp</span> <span class="n">QUICKSTART_HOME</span><span class="o">/</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>  <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
    <span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">copy</span> <span class="n">QUICKSTART_HOME</span><span class="o">/</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span> <span class="err">\</span><span class="n">Documents</span> <span class="n">and</span> <span class="n">Settings</span><span class="err">\</span><span class="n">USER_NAME</span><span class="err">\</span><span class="p">.</span><span class="n">m2</span><span class="err">\</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span> 
            <span class="o">-</span><span class="n">or</span><span class="o">-</span> <span class="n">copy</span> <span class="n">QUICKSTART_HOME</span><span class="o">/</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span> <span class="err">\</span><span class="n">Users</span><span class="err">\</span><span class="n">USER_NAME</span><span class="err">\</span><span class="p">.</span><span class="n">m2</span><span class="err">\</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
</pre></div></li>
</ol>

<h3><a id="restore-your-maven-configuration-when-you-finish-testing-the-quickstarts" class="anchor" href="#restore-your-maven-configuration-when-you-finish-testing-the-quickstarts"><span class="anchor-icon"></span></a>Restore Your Maven Configuration When You Finish Testing the Quickstarts</h3>

<ol>
<li><p>Locate the Maven install directory for your operating system. It is usually installed in <code>${user.home}/.m2/</code>. </p>
<div class="highlight"><pre>    <span class="n">For</span> <span class="n">Linux</span> <span class="n">or</span> <span class="n">Mac</span><span class="o">:</span>   <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span>
    <span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="err">\</span><span class="n">Documents</span> <span class="n">and</span> <span class="n">Settings</span><span class="err">\</span><span class="n">USER_NAME</span><span class="err">\</span><span class="p">.</span><span class="n">m2</span><span class="err">\</span>  <span class="o">-</span><span class="n">or</span><span class="o">-</span>  <span class="err">\</span><span class="n">Users</span><span class="err">\</span><span class="n">USER_NAME</span><span class="err">\</span><span class="p">.</span><span class="n">m2</span>\
</pre></div></li>
<li><p>Restore the <code>settings.xml</code> file/</p>
<div class="highlight"><pre>    <span class="n">For</span> <span class="n">Linux</span> <span class="n">or</span> <span class="n">Mac</span><span class="o">:</span>  <span class="n">mv</span> <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span><span class="n">settings</span><span class="o">-</span><span class="n">backup</span><span class="p">.</span><span class="n">xml</span> <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span><span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
    <span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">ren</span> <span class="s">&quot;\Documents and Settings\USER_NAME\.m2\settings-backup.xml&quot;</span> <span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
            <span class="o">-</span><span class="n">or</span><span class="o">-</span> <span class="n">ren</span> <span class="s">&quot;\Users\USER_NAME\.m2\settings-backup.xml&quot;</span> <span class="n">settings</span><span class="p">.</span><span class="n">xml</span>
</pre></div></li>
<li><p>Restore the <code>repository/</code> directory</p>
<div class="highlight"><pre>    <span class="n">For</span> <span class="n">Linux</span> <span class="n">or</span> <span class="n">Mac</span><span class="o">:</span>  <span class="n">mv</span> <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span><span class="n">repository</span><span class="o">-</span><span class="n">backup</span><span class="o">/</span> <span class="o">~/</span><span class="p">.</span><span class="n">m2</span><span class="o">/</span><span class="n">repository</span><span class="o">/</span>
    <span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">ren</span> <span class="s">&quot;\Documents and Settings\USER_NAME\.m2</span><span class="se">\r</span><span class="s">epository-backup</span><span class="se">\&quot;</span><span class="s"> repository</span>
            <span class="o">-</span><span class="n">or</span><span class="o">-</span> <span class="n">ren</span> <span class="s">&quot;\Users\USER_NAME\.m2</span><span class="se">\r</span><span class="s">epository</span><span class="se">\&quot;</span><span class="s"> repository-backup</span>
</pre></div></li>
</ol>

<h3><a id="maven-profiles" class="anchor" href="#maven-profiles"><span class="anchor-icon"></span></a>Maven Profiles</h3>

<p>Profiles are used by Maven to customize the build environment. The <code>pom.xml</code> in the root of the quickstart directory defines the following profiles:</p>

<ul>
<li>The <code>default</code> profile defines the list of modules or quickstarts that require nothing but JBoss Enterprise Application Platform.</li>
<li>The <code>requires-postgres</code> profile lists the quickstarts that require PostgreSQL to be running when the quickstart is deployed.</li>
<li>The <code>complex-dependency</code> profile lists quickstarts that require manual configuration that can not be automated.</li>
<li>The <code>requires-full</code> profile lists quickstarts the require you start the JBoss server using the full profile.</li>
<li>The <code>requires-xts</code> profile lists quickstarts the require you start the JBoss server using the xts profile.</li>
<li>The <code>non-maven</code> profile lists quickstarts that do not require Maven, for example, quickstarts that depend on deployment of other quickstarts or those that use other Frameworks such as Forge.</li>
</ul>

<h2><a id="run-the-quickstarts" class="anchor" href="#run-the-quickstarts"><span class="anchor-icon"></span></a>Run the Quickstarts</h2>

<p>The root folder of each individual quickstart contains a README file with specific details on how to build and run the example. In most cases you do the following:</p>

<ul>
<li><a href="#start-the-jboss-server">Start the JBoss server</a></li>
<li><a href="#build-and-deploy-the-quickstarts">Build and deploy the quickstarts</a></li>
</ul>

<h3><a id="start-the-jboss-server" class="anchor" href="#start-the-jboss-server"><span class="anchor-icon"></span></a>Start the JBoss Server</h3>

<p>Before you deploy a quickstart, in most cases you need a running JBoss EAP server. A few of the Arquillian tests do not require a running server. This will be noted in the README for that quickstart. </p>

<p>The JBoss server can be started a few different ways.</p>

<ul>
<li><a href="#start-the-default-jboss-server">Start the Default JBoss Server</a>: This is the default configuration. It defines minimal subsystems and services.</li>
<li><a href="#start-the-jboss-server-with-the-full-profile">Start the JBoss Server with the <em>full</em> profile</a>: This profile configures many of the commonly used subsystems and services.</li>
<li><a href="#start-the-jboss-server-with-custom-configuration-options">Start the JBoss Server with a custom configuration</a>: Custom configuration parameters can be specified on the command line when starting the server.</li>
</ul>

<p>The README for each quickstart will specify which configuration is required to run the example.</p>

<h4><a id="start-the-default-jboss-server" class="anchor" href="#start-the-default-jboss-server"><span class="anchor-icon"></span></a>Start the Default JBoss Server</h4>

<p>To start JBoss EAP:</p>

<ol>
<li>Open a command line and navigate to the root of the JBoss server directory.</li>
<li><p>The following shows the command line to start the JBoss server:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="o">:</span>   <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span>
<span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">JBOSS_HOME</span><span class="err">\</span><span class="n">bin</span><span class="err">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span>
</pre></div></li>
</ol>

<h4><a id="start-the-jboss-server-with-the-full-profile" class="anchor" href="#start-the-jboss-server-with-the-full-profile"><span class="anchor-icon"></span></a>Start the JBoss Server with the Full Profile</h4>

<p>To start JBoss EAP with the Full Profile:</p>

<ol>
<li>Open a command line and navigate to the root of the JBoss server directory.</li>
<li><p>The following shows the command line to start the JBoss server with the full profile:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="o">:</span>   <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
<span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">JBOSS_HOME</span><span class="err">\</span><span class="n">bin</span><span class="err">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
</pre></div></li>
</ol>

<h4><a id="start-the-jboss-server-with-custom-configuration-options" class="anchor" href="#start-the-jboss-server-with-custom-configuration-options"><span class="anchor-icon"></span></a>Start the JBoss Server with Custom Configuration Options</h4>

<p>To start JBoss EAP with custom configuration options:</p>

<ol>
<li>Open a command line and navigate to the root of the JBoss server directory.</li>
<li><p>The following shows the command line to start the JBoss server. Replace the CUSTOM_OPTIONS with the custom optional parameters specified in the quickstart.</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="o">:</span>   <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span> <span class="n">CUSTOM_OPTIONS</span>
<span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">JBOSS_HOME</span><span class="err">\</span><span class="n">bin</span><span class="err">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span> <span class="n">CUSTOM_OPTIONS</span>
</pre></div></li>
</ol>

<h3><a id="build-and-deploy-the-quickstarts" class="anchor" href="#build-and-deploy-the-quickstarts"><span class="anchor-icon"></span></a>Build and Deploy the Quickstarts</h3>

<p>See the README file in each individual quickstart folder for specific details and information on how to run and access the example.</p>

<h4><a id="build-the-quickstart-archive" class="anchor" href="#build-the-quickstart-archive"><span class="anchor-icon"></span></a>Build the Quickstart Archive</h4>

<p>In some cases, you may want to build the application to test for compile errors or view the contents of the archive. </p>

<ol>
<li>Open a command line and navigate to the root directory of the quickstart you want to build.</li>
<li><p>Use this command if you only want to build the archive, but not deploy it:</p>
<div class="highlight"><pre>    <span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span>
</pre></div></li>
</ol>

<h4><a id="build-and-deploy-the-quickstart-archive" class="anchor" href="#build-and-deploy-the-quickstart-archive"><span class="anchor-icon"></span></a>Build and Deploy the Quickstart Archive</h4>

<ol>
<li>Make sure you <a href="#start-the-jboss-server">start the JBoss server</a> as described in the README.</li>
<li>Open a command line and navigate to the root directory of the quickstart you want to run.</li>
<li><p>Use this command to build and deploy the archive:</p>
<div class="highlight"><pre>    <span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="n">jboss</span><span class="o">-</span><span class="n">as</span><span class="o">:</span><span class="n">deploy</span>
</pre></div></li>
</ol>

<h4><a id="undeploy-an-archive" class="anchor" href="#undeploy-an-archive"><span class="anchor-icon"></span></a>Undeploy an Archive</h4>

<p>The command to undeploy the quickstart is simply: </p>
<div class="highlight"><pre>    <span class="n">mvn</span> <span class="n">jboss</span><span class="o">-</span><span class="n">as</span><span class="o">:</span><span class="n">undeploy</span>
</pre></div>
<h3><a id="verify-the-quickstarts-build-with-one-command" class="anchor" href="#verify-the-quickstarts-build-with-one-command"><span class="anchor-icon"></span></a>Verify the Quickstarts Build with One Command</h3>

<hr/>

<p>You can verify the quickstarts build using one command. However, quickstarts that have complex dependencies must be skipped. For example, the <em>jax-rs-client</em> quickstart is a RESTEasy client that depends on the deployment of the <em>helloworld-rs</em> quickstart. As noted above, the root <code>pom.xml</code> file defines a <code>complex-dependencies</code> profile to exclude these quickstarts from the root build process. </p>

<p>To build the quickstarts:</p>

<ol>
<li>Do not start the JBoss server.</li>
<li>Open a command line and navigate to the root directory of the quickstarts.</li>
<li><p>Use this command to build the quickstarts that do not have complex dependencies:</p>
<div class="highlight"><pre>    <span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="err">&#39;</span><span class="o">-</span><span class="n">Pdefault</span><span class="p">,</span><span class="o">!</span><span class="n">complex</span><span class="o">-</span><span class="n">dependencies</span><span class="err">&#39;</span>
</pre></div></li>
</ol>

<p><em>Note</em>: If you see a <code>java.lang.OutOfMemoryError: PermGen space</code> error when you run this command, increase the memory by typing the following command for your operating system, then try the above command again.</p>
<div class="highlight"><pre>    <span class="n">For</span> <span class="n">Linux</span><span class="o">:</span>   <span class="n">export</span> <span class="n">MAVEN_OPTS</span><span class="o">=</span><span class="s">&quot;-Xmx512m -XX:MaxPermSize=128m&quot;</span>
    <span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">SET</span> <span class="n">MAVEN_OPTS</span><span class="o">=</span><span class="s">&quot;-Xmx512m -XX:MaxPermSize=128m&quot;</span>
</pre></div>
<h3><a id="undeploy-the-deployed-quickstarts-with-one-command" class="anchor" href="#undeploy-the-deployed-quickstarts-with-one-command"><span class="anchor-icon"></span></a>Undeploy the Deployed Quickstarts with One Command</h3>

<hr/>

<p>To undeploy the quickstarts from the root of the quickstart folder, you must pass the argument <code>-fae</code> (fail at end) on the command line. This allows the command to continue past quickstarts that fail due to complex dependencies and quickstarts that only have Arquillian tests and do not deploy archives to the server.</p>

<p>You can undeploy quickstarts using the following procedure:</p>

<ol>
<li>Start the JBoss server.</li>
<li>Open a command line and navigate to the root directory of the quickstarts.</li>
<li><p>Use this command to undeploy any deployed quickstarts:</p>
<div class="highlight"><pre>    <span class="n">mvn</span> <span class="n">jboss</span><span class="o">-</span><span class="n">as</span><span class="o">:</span><span class="n">undeploy</span> <span class="o">-</span><span class="n">fae</span>
</pre></div></li>
</ol>

<p>To undeploy any quickstarts that fail due to complex dependencies, follow the undeploy procedure described in the quickstart&rsquo;s README file.</p>

<h3><a id="run-the-arquillian-tests" class="anchor" href="#run-the-arquillian-tests"><span class="anchor-icon"></span></a>Run the Arquillian Tests</h3>

<hr/>

<p>Some of the quickstarts provide Arquillian tests. By default, these tests are configured to be skipped, as Arquillian tests an application on a real server, not just in a mocked environment.</p>

<p>You can either start the server yourself or let Arquillian manage its lifecycle during the testing. The individual quickstart README should tell you what to expect in the console output and the server log when you run the test.</p>

<ol>
<li><p>Test the quickstart on a remote server</p>

<ul>
<li>Arquillian&rsquo;s remote container adapter expects a JBoss server instance to be already started prior to the test execution. You must <a href="#start-the-jboss-server">Start the JBoss server</a> as described in the quickstart README file.</li>
<li><p>If you need to run the tests on a JBoss server running on a machine other than localhost, you can configure this, along with other options, in the <code>src/test/resources/arquillian.xml</code> file using the following properties:</p>
<div class="highlight"><pre><span class="nt">&lt;container</span> <span class="na">qualifier=</span><span class="s">&quot;jboss&quot;</span> <span class="na">default=</span><span class="s">&quot;true&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;configuration&gt;</span>
        <span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;managementAddress&quot;</span><span class="nt">&gt;</span>myhost.example.com<span class="nt">&lt;/property&gt;</span>
        <span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;managementPort&quot;</span><span class="nt">&gt;</span>9999<span class="nt">&lt;/property&gt;</span>
        <span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;username&quot;</span><span class="nt">&gt;</span>customAdminUser<span class="nt">&lt;/property&gt;</span>
        <span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;password&quot;</span><span class="nt">&gt;</span>myPassword<span class="nt">&lt;/property&gt;</span>
    <span class="nt">&lt;/configuration&gt;</span>
<span class="nt">&lt;/container&gt;</span>    
</pre></div></li>
<li><p>Run the test goal with the following profile activated:</p>
<div class="highlight"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">test</span> <span class="o">-</span><span class="n">Parq</span><span class="o">-</span><span class="n">jbossas</span><span class="o">-</span><span class="n">remote</span>     
</pre></div></li>
</ul></li>
<li><p>Test the quickstart on a managed server</p>

<p>Arquillian&rsquo;s managed container adapter requires that your server is not running as it will start the container for you. However, you must first let it know where to find the JBoss server directory. The simplest way to do this is to set the <code>JBOSS_HOME</code> environment variable to the full path to your JBoss server directory. Alternatively, you can set the path in the <code>jbossHome</code> property in the Arquillian configuration file.</p>

<ul>
<li>Open the <code>src/test/resources/arquillian.xml</code> file located in the quickstart directory.</li>
<li><p>Find the configuration for the JBoss container. It should look like this:</p>
<div class="highlight"><pre><span class="c">&lt;!-- Example configuration for a managed/remote JBoss EAP 6 instance --&gt;</span>
<span class="nt">&lt;container</span> <span class="na">qualifier=</span><span class="s">&quot;jboss&quot;</span> <span class="na">default=</span><span class="s">&quot;true&quot;</span><span class="nt">&gt;</span>
    <span class="c">&lt;!-- If you want to use the JBOSS_HOME environment variable, just delete the jbossHome property --&gt;</span>
    <span class="c">&lt;!--&lt;configuration&gt; --&gt;</span>
    <span class="c">&lt;!--&lt;property name=&quot;jbossHome&quot;&gt;/path/to/jboss/as&lt;/property&gt; --&gt;</span>
    <span class="c">&lt;!--&lt;/configuration&gt; --&gt;</span>
<span class="nt">&lt;/container&gt;</span>           
</pre></div></li>
<li><p>Uncomment the <code>configuration</code> element, find the <code>jbossHome</code> property and replace the &ldquo;/path/to/jboss/as&rdquo; value with the actual path to your JBoss EAP server.</p></li>
<li><p>Run the test goal with the following profile activated:</p>
<div class="highlight"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">test</span> <span class="o">-</span><span class="n">Parq</span><span class="o">-</span><span class="n">jbossas</span><span class="o">-</span><span class="n">managed</span>
</pre></div></li>
</ul></li>
</ol>

<h2><a id="use-jboss-developer-studio-or-eclipse-to-run-the-quickstarts" class="anchor" href="#use-jboss-developer-studio-or-eclipse-to-run-the-quickstarts"><span class="anchor-icon"></span></a>Use JBoss Developer Studio or Eclipse to Run the Quickstarts</h2>

<p>You can also deploy the quickstarts from Eclipse using JBoss tools. For more information on how to set up Maven and the JBoss tools, refer to the <a href="https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/">JBoss Enterprise Application Platform Development Guide</a> or <a href="http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/guide/Introduction/" title="Get Started Developing Applications">Get Started Developing Applications</a>.</p>

<h2><a id="optional-components" class="anchor" href="#optional-components"><span class="anchor-icon"></span></a>Optional Components</h2>

<p>The following components are needed for only a small subset of the quickstarts. Do not install or configure them unless the quickstart requires it.</p>

<ul>
<li><p><a href="#add-a-management-or-application-user">Add a User</a>: Add a Management or Application user for the quickstarts that run in a secured mode.</p></li>
<li><p><a href="#install-and-configure-the-postgresql-database">Install and Configure the PostgreSQL Database</a>: The PostgreSQL database is used for the distributed transaction quickstarts.</p></li>
<li><p><a href="#install-and-configure-byteman">Install and Configure Byteman</a>: This tool is used to demonstrate crash recovery for distributed transaction quickstarts.</p></li>
</ul>

<h3><a id="add-a-management-or-application-user" class="anchor" href="#add-a-management-or-application-user"><span class="anchor-icon"></span></a>Add a Management or Application User</h3>

<p>By default, JBoss EAP is now distributed with security enabled for the management interfaces. A few of the quickstarts use these management interfaces and require that you create a management or application user to access the running application. A script is provided in the <code>JBOSS_HOME/bin</code> directory for that purpose.</p>

<p>The following procedures describe how to add a user with the appropriate permissions to run the quickstarts that depend on them.</p>

<h4><a id="add-a-management-user" class="anchor" href="#add-a-management-user"><span class="anchor-icon"></span></a>Add a Management User</h4>

<ol>
<li>Open a command line</li>
<li><p>Type the command for your operating system</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="o">:</span>   <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">add</span><span class="o">-</span><span class="n">user</span><span class="p">.</span><span class="n">sh</span>
<span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">JBOSS_HOME</span><span class="err">\</span><span class="n">bin</span><span class="err">\</span><span class="n">add</span><span class="o">-</span><span class="n">user</span><span class="p">.</span><span class="n">bat</span>
</pre></div></li>
<li><p>You should see the following response:</p>
<div class="highlight"><pre><span class="n">What</span> <span class="n">type</span> <span class="n">of</span> <span class="n">user</span> <span class="k">do</span> <span class="n">you</span> <span class="n">wish</span> <span class="n">to</span> <span class="n">add</span><span class="o">?</span> 

<span class="n">a</span><span class="p">)</span> <span class="n">Management</span> <span class="n">User</span> <span class="p">(</span><span class="n">mgmt</span><span class="o">-</span><span class="n">users</span><span class="p">.</span><span class="n">properties</span><span class="p">)</span> 
<span class="n">b</span><span class="p">)</span> <span class="n">Application</span> <span class="n">User</span> <span class="p">(</span><span class="n">application</span><span class="o">-</span><span class="n">users</span><span class="p">.</span><span class="n">properties</span><span class="p">)</span>
<span class="p">(</span><span class="n">a</span><span class="p">)</span><span class="o">:</span>
</pre></div>
<p>At the prompt, press enter to use the default Management User</p></li>
<li><p>You should see the following response:</p>
<div class="highlight"><pre><span class="n">Enter</span> <span class="n">the</span> <span class="n">details</span> <span class="n">of</span> <span class="n">the</span> <span class="n">new</span> <span class="n">user</span> <span class="n">to</span> <span class="n">add</span><span class="p">.</span>
<span class="n">Realm</span> <span class="p">(</span><span class="n">ManagementRealm</span><span class="p">)</span> <span class="o">:</span> 
</pre></div>
<p>If the quickstart README specifies a realm, type it here. Otherwise, press enter to use the default <code>ManagementRealm</code>. </p></li>
<li><p>When prompted, enter the following</p>
<div class="highlight"><pre><span class="n">Username</span> <span class="o">:</span> <span class="n">admin</span>
<span class="n">Password</span> <span class="o">:</span> <span class="o">(</span><span class="n">choose</span> <span class="n">a</span> <span class="n">password</span> <span class="k">for</span> <span class="n">the</span> <span class="n">admin</span> <span class="n">user</span><span class="o">)</span>
</pre></div>
<p>Repeat the password</p></li>
<li><p>Choose yes for the remaining promts.</p></li>
</ol>

<h4><a id="add-an-application-user" class="anchor" href="#add-an-application-user"><span class="anchor-icon"></span></a>Add an Application User</h4>

<ol>
<li>Open a command line</li>
<li><p>Type the command for your operating system</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="o">:</span>   <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">add</span><span class="o">-</span><span class="n">user</span><span class="p">.</span><span class="n">sh</span>
<span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">JBOSS_HOME</span><span class="err">\</span><span class="n">bin</span><span class="err">\</span><span class="n">add</span><span class="o">-</span><span class="n">user</span><span class="p">.</span><span class="n">bat</span>
</pre></div></li>
<li><p>You should see the following response:</p>
<div class="highlight"><pre><span class="n">What</span> <span class="n">type</span> <span class="n">of</span> <span class="n">user</span> <span class="k">do</span> <span class="n">you</span> <span class="n">wish</span> <span class="n">to</span> <span class="n">add</span><span class="o">?</span> 

<span class="n">a</span><span class="p">)</span> <span class="n">Management</span> <span class="n">User</span> <span class="p">(</span><span class="n">mgmt</span><span class="o">-</span><span class="n">users</span><span class="p">.</span><span class="n">properties</span><span class="p">)</span> 
<span class="n">b</span><span class="p">)</span> <span class="n">Application</span> <span class="n">User</span> <span class="p">(</span><span class="n">application</span><span class="o">-</span><span class="n">users</span><span class="p">.</span><span class="n">properties</span><span class="p">)</span>
<span class="p">(</span><span class="n">a</span><span class="p">)</span><span class="o">:</span>
</pre></div>
<p>At the prompt, type:  b</p></li>
<li><p>You should see the following response:</p>
<div class="highlight"><pre><span class="n">Enter</span> <span class="n">the</span> <span class="n">details</span> <span class="n">of</span> <span class="n">the</span> <span class="n">new</span> <span class="n">user</span> <span class="n">to</span> <span class="n">add</span><span class="p">.</span>
<span class="n">Realm</span> <span class="p">(</span><span class="n">ApplicationRealm</span><span class="p">)</span> <span class="o">:</span> 
</pre></div>
<p>If the quickstart README specifies a realm, type it here. Otherwise, press enter to use the default <code>ApplicationRealm</code>. </p></li>
<li><p>When prompted, enter the the Username and Passord. If the quickstart README specifies a Username and Password, enter them here. Otherwise, use the default Username <code>quickstartUser</code> and Password <code>quickstartPwd1!</code>.</p>
<div class="highlight"><pre><span class="n">Username</span> <span class="o">:</span> <span class="n">quickstartUser</span>
<span class="n">Password</span> <span class="o">:</span> <span class="n">quickstartPwd1</span><span class="o">!</span>
</pre></div></li>
<li><p>At the next prompt, you will be asked &ldquo;What roles do you want this user to belong to?&rdquo;. If the quickstart README specifies a role to use, enter that here. Otherwise, type the role: <code>guest</code></p></li>
</ol>

<h3><a id="install-and-configure-the-postgresql-database" class="anchor" href="#install-and-configure-the-postgresql-database"><span class="anchor-icon"></span></a>Install and Configure the PostgreSQL Database</h3>

<p>Some of the quickstarts require the PostgreSQL database. This section describes how to install and configure the database for use with these quickstarts.</p>

<h4><a id="download-and-install-postgresql" class="anchor" href="#download-and-install-postgresql"><span class="anchor-icon"></span></a>Download and Install PostgreSQL</h4>

<p>The following is a brief overview of how to install PostgreSQL version 9.2. If you install a later version, be sure to modify the version when you issue the commands below. More detailed instructions for installing and starting PostgreSQL can be found on the internet.</p>

<p><em>Note</em>: Although the database only needs to be installed once, to help partition each quickstart we recommend using a separate database per quickstart. Where you see QUICKSTART_DATABASENAME, you should replace that with the name provided in the particular quickstart&rsquo;s README</p>

<h5><a id="linux-instructions" class="anchor" href="#linux-instructions"><span class="anchor-icon"></span></a>Linux Instructions</h5>

<p>Use the following steps to install and configure PostgreSQL on Linux. You can download the PDF installation guide here: <a href="http://yum.postgresql.org/files/PostgreSQL-RPM-Installation-PGDG.pdf">http://yum.postgresql.org/files/PostgreSQL-RPM-Installation-PGDG.pdf</a></p>

<ol>
<li><p>Install PostgreSQL</p>

<ul>
<li>The yum install instructions for PostgreSQL can be found here: <a href="http://yum.postgresql.org/howtoyum.php/">http://yum.postgresql.org/howtoyum.php/</a></li>
<li>Download the repository RPM from here: <a href="http://yum.postgresql.org/repopackages.php/">http://yum.postgresql.org/repopackages.php/</a></li>
<li><p>To install PostgreSQL, in a command line type <code>sudo rpm -ivh RPM_FILE_NAME</code>, where RPM_FILE_NAME is the name of the downloaded repository RPM file, for example:</p>
<div class="highlight"><pre><span class="n">sudo</span> <span class="n">rpm</span> <span class="o">-</span><span class="n">ivh</span> <span class="n">pgdg</span><span class="o">-</span><span class="n">fedora92</span><span class="o">-</span><span class="mf">9.2</span><span class="o">-</span><span class="mf">5.</span><span class="n">noarch</span><span class="p">.</span><span class="n">rpm</span>
</pre></div></li>
<li><p>Edit your distributions package manager definitions to exclude PostgreSQL. See the &ldquo;important note&rdquo; on <a href="http://yum.postgresql.org/howtoyum.php/">http://yum.postgresql.org/howtoyum.php/</a> for details on how to exclude install-and-configure-the-postgresql-database packages from the repository of the distribution.</p></li>
<li><p>Install <em>postgresql92</em> and <em>postgres92-server</em> by typing the following in a command line:</p>
<div class="highlight"><pre><span class="n">sudo</span> <span class="n">yum</span> <span class="n">install</span> <span class="n">postgresql92</span> <span class="n">postgresql92</span><span class="o">-</span><span class="n">server</span>
</pre></div></li>
</ul></li>
<li><p>Set a password for the <em>postgres</em> user</p>

<ul>
<li><p>In a command line, login as root and set the postgres password by typing the following commands: </p>
<div class="highlight"><pre><span class="n">su</span>
<span class="n">passwd</span> <span class="n">postgres</span>
</pre></div></li>
<li><p>Choose a password</p></li>
</ul></li>
<li><p>Configure the test database</p>

<ul>
<li><p>In a command line, login as the <em>postgres</em> user, navigate to the postgres directory, and initialize the database by typing:</p>
<div class="highlight"><pre><span class="n">su</span> <span class="n">postgres</span>
<span class="n">cd</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">pgsql</span><span class="o">-</span><span class="mf">9.2</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span>
<span class="p">.</span><span class="o">/</span><span class="n">initdb</span> <span class="o">-</span><span class="n">D</span> <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">pgsql</span><span class="o">/</span><span class="mf">9.2</span><span class="o">/</span><span class="n">data</span>
</pre></div></li>
<li><p>Modify the <code>/var/lib/pgsql/9.2/data/pg_hba.conf</code> file to set the authentication scheme to password for tcp connections. Modify the line following the IPv4 local connections: change trust to to password. The line should look like this:</p>
<div class="highlight"><pre><span class="n">host</span>    <span class="n">all</span>    <span class="n">all</span>    <span class="mf">127.0.0.1</span><span class="o">/</span><span class="mi">32</span>    <span class="n">password</span>
</pre></div></li>
<li><p>Modify the <code>/var/lib/pgsql/9.2/data/postgresql.conf</code> file to allow prepared transactions and reduce the maximum number of connections</p>
<div class="highlight"><pre><span class="n">max_prepared_transactions</span> <span class="o">=</span> <span class="mi">10</span>
<span class="n">max_connections</span> <span class="o">=</span> <span class="mi">10</span>
</pre></div></li>
</ul></li>
<li><p>Start the database server </p>

<ul>
<li><p>In the same command line, type the following:</p>
<div class="highlight"><pre><span class="p">.</span><span class="o">/</span><span class="n">postgres</span> <span class="o">-</span><span class="n">D</span> <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">pgsql</span><span class="o">/</span><span class="mf">9.2</span><span class="o">/</span><span class="n">data</span>
</pre></div></li>
<li><p>Note, this command does not release the command line. In the next step you need to open a new command line.</p></li>
</ul></li>
<li><p>Create a database for the quickstart (as noted above, replace QUICKSTART_DATABASENAME with the name provided in the particular quickstart)</p>

<ul>
<li><p>Open a new command line and login again as the <em>postgres</em> user, navigate to the postgres directory, and create the  database by typing the following:</p>
<div class="highlight"><pre><span class="n">su</span> <span class="n">postgres</span>
<span class="n">cd</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">pgsql</span><span class="o">-</span><span class="mf">9.2</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span>
<span class="p">.</span><span class="o">/</span><span class="n">createdb</span> <span class="n">QUICKSTART_DATABASENAME</span>
</pre></div></li>
</ul></li>
</ol>

<h5><a id="mac-os-x-instructions" class="anchor" href="#mac-os-x-instructions"><span class="anchor-icon"></span></a>Mac OS X Instructions</h5>

<p>The following are the steps to install and start PostgreSQL on Mac OS X. Note that this guide covers only &lsquo;One click installer&rsquo; option.</p>

<ol>
<li>Install PostgreSQL using Mac OS X One click installer: <a href="http://www.postgresql.org/download/macosx/">http://www.postgresql.org/download/macosx/</a></li>
<li><p>Allow prepared transactions:</p>
<div class="highlight"><pre><span class="n">sudo</span> <span class="n">su</span> <span class="o">-</span> <span class="n">postgres</span>
</pre></div>
<ul>
<li><p>Edit <code>/Library/PostgreSQL/9.2/data/postgresql.conf</code> to allow prepared transactions</p>
<div class="highlight"><pre><span class="n">max_prepared_transactions</span> <span class="o">=</span> <span class="mi">10</span>
</pre></div></li>
</ul></li>
<li><p>Start the database server </p>
<div class="highlight"><pre><span class="n">cd</span> <span class="o">/</span><span class="n">Library</span><span class="o">/</span><span class="n">PostgreSQL</span><span class="o">/</span><span class="mf">9.2</span><span class="o">/</span><span class="n">bin</span>
<span class="p">.</span><span class="o">/</span><span class="n">pg_ctl</span> <span class="o">-</span><span class="n">D</span> <span class="p">..</span><span class="o">/</span><span class="n">data</span> <span class="n">restart</span>
</pre></div></li>
<li><p>Create a database for the quickstart (as noted above, replace QUICKSTART_DATABASENAME with the name provided in the particular quickstart)</p>
<div class="highlight"><pre><span class="p">.</span><span class="o">/</span><span class="n">createdb</span> <span class="n">QUICKSTART_DATABASENAME</span>
</pre></div></li>
<li><p>Verify that everything works. As the <em>postgres</em> user using the password you specified in Step 1, type the following:</p>
<div class="highlight"><pre><span class="n">cd</span> <span class="o">/</span><span class="n">Library</span><span class="o">/</span><span class="n">PostgreSQL</span><span class="o">/</span><span class="mf">9.2</span><span class="o">/</span><span class="n">bin</span>
<span class="p">.</span><span class="o">/</span><span class="n">psql</span> <span class="o">-</span><span class="n">U</span> <span class="n">postgres</span>    
</pre></div>
<p>At the prompt</p>
<div class="highlight"><pre><span class="n">start</span> <span class="n">transaction</span><span class="p">;</span>
<span class="n">select</span> <span class="mi">1</span><span class="p">;</span>
<span class="n">prepare</span> <span class="n">transaction</span> <span class="err">&#39;</span><span class="n">foobar</span><span class="err">&#39;</span><span class="p">;</span>
<span class="n">commit</span> <span class="n">prepared</span> <span class="err">&#39;</span><span class="n">foobar</span><span class="err">&#39;</span><span class="p">;</span>
</pre></div></li>
</ol>

<h5><a id="windows-instructions" class="anchor" href="#windows-instructions"><span class="anchor-icon"></span></a>Windows Instructions</h5>

<p>Use the following steps to install and configure PostgreSQL on Windows:</p>

<ol>
<li>Install PostgreSQL using the Windows installer: <a href="http://www.postgresql.org/download/windows/">http://www.postgresql.org/download/windows/</a></li>
<li><p>Enable password authentication and configure PostgreSQL to allow prepared transactions</p>

<ul>
<li><p>Modify the <code>C:\Program Files\PostgreSQL\9.2\data\pg_hba.conf</code> file to set the authentication scheme to password for tcp connections. Modify the line following the IPv4 local connections: change trust to to password. The line should look like this:</p>
<div class="highlight"><pre><span class="n">host</span>    <span class="n">all</span>    <span class="n">all</span>    <span class="mf">127.0.0.1</span><span class="o">/</span><span class="mi">32</span>    <span class="n">password</span><span class="err">`</span>
</pre></div></li>
<li><p>Modify the <code>C:\Program Files\PostgreSQL\9.2\data\postgresql.conf</code> file to allow prepared transactions and reduce the maximum number of connections:</p>
<div class="highlight"><pre><span class="n">max_prepared_transactions</span> <span class="o">=</span> <span class="mi">10</span>
<span class="n">max_connections</span> <span class="o">=</span> <span class="mi">10</span>
</pre></div></li>
</ul></li>
<li><p>Start the database server</p>

<ul>
<li>Choose Start -> All Programs -> PostgreSQL 9.2\pgAdmin III</li>
<li>Server Groups -> Servers (1) -> PostgreSQL 9.2 (localhost:5432)</li>
<li>Right click -> Stop Service</li>
<li>Right click -> Start Service</li>
</ul></li>
<li><p>Create a database for the quickstart (as noted above, replace QUICKSTART_DATABASENAME with the name provided in the particular quickstart)</p>

<ul>
<li><p>Open a command line</p>
<div class="highlight"><pre><span class="n">cd</span> <span class="n">C</span><span class="o">:</span><span class="err">\</span><span class="n">Program</span> <span class="n">Files</span><span class="err">\</span><span class="n">PostgreSQL</span><span class="err">\</span><span class="mf">9.2</span><span class="err">\</span><span class="n">bin</span>\
<span class="n">createdb</span><span class="p">.</span><span class="n">exe</span> <span class="o">-</span><span class="n">U</span> <span class="n">postgres</span> <span class="n">QUICKSTART_DATABASENAME</span>
</pre></div></li>
</ul></li>
</ol>

<h4><a id="create-a-database-user" class="anchor" href="#create-a-database-user"><span class="anchor-icon"></span></a>Create a Database User</h4>

<ol>
<li> Make sure the PostgreSQL bin directory is in your PATH. 

<ul>
<li>Open a command line and change to the root directory
    psql</li>
<li>If you see an error that &lsquo;psql&rsquo; is not a recognized command, you need to add the PostgreSQL bin directory to your PATH environment variable. </li>
</ul></li>
<li><p>As the <em>postgres</em> user, start the PostgreSQL interactive terminal by typing the following command:</p>
<div class="highlight"><pre><span class="n">psql</span> <span class="o">-</span><span class="n">U</span> <span class="n">postgres</span>
</pre></div></li>
<li><p>Create the user sa with password sa and all privileges on the database by typing the following commands (as noted above, replace QUICKSTART_DATABASENAME with the name provided in the particular quickstart):</p>
<div class="highlight"><pre><span class="n">create</span> <span class="n">user</span> <span class="n">sa</span> <span class="n">with</span> <span class="n">password</span> <span class="err">&#39;</span><span class="n">sa</span><span class="err">&#39;</span><span class="p">;</span>
<span class="n">grant</span> <span class="n">all</span> <span class="n">privileges</span> <span class="n">on</span> <span class="n">database</span> <span class="s">&quot;QUICKSTART_DATABASENAME&quot;</span> <span class="n">to</span> <span class="n">sa</span><span class="p">;</span>
<span class="err">\</span><span class="n">q</span>
</pre></div></li>
<li><p>Test the connection to the database using the TCP connection as user <code>&#39;sa&#39;</code>. This validates that the change to <code>pg_hba.conf</code> was made correctly: </p>
<div class="highlight"><pre><span class="n">psql</span> <span class="o">-</span><span class="n">h</span> <span class="mf">127.0.0.1</span> <span class="o">-</span><span class="n">U</span> <span class="n">sa</span> <span class="n">QUICKSTART_DATABASENAME</span>
</pre></div></li>
</ol>

<h4><a id="add-the-postgresql-module-to-the-jboss-server" class="anchor" href="#add-the-postgresql-module-to-the-jboss-server"><span class="anchor-icon"></span></a>Add the PostgreSQL Module to the JBoss server</h4>

<ol>
<li>Create the following directory structure: <code>JBOSS_HOME/modules/org/postgresql/main</code></li>
<li>Download the JBDC driver from <a href="http://jdbc.postgresql.org/download.html">http://jdbc.postgresql.org/download.html</a> and copy it into the directory you created in the previous step.</li>
<li><p>In the same directory, create a file named module.xml. Copy the following contents into the file:</p>
<div class="highlight"><pre><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span class="nt">&lt;module</span> <span class="na">xmlns=</span><span class="s">&quot;urn:jboss:module:1.0&quot;</span> <span class="na">name=</span><span class="s">&quot;org.postgresql&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;resources&gt;</span>
        <span class="nt">&lt;resource-root</span> <span class="na">path=</span><span class="s">&quot;postgresql-9.2-1002.jdbc4.jar&quot;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;/resources&gt;</span>
    <span class="nt">&lt;dependencies&gt;</span>
        <span class="nt">&lt;module</span> <span class="na">name=</span><span class="s">&quot;javax.api&quot;</span><span class="nt">/&gt;</span>
        <span class="nt">&lt;module</span> <span class="na">name=</span><span class="s">&quot;javax.transaction.api&quot;</span><span class="nt">/&gt;</span>
    <span class="nt">&lt;/dependencies&gt;</span>
<span class="nt">&lt;/module&gt;</span>
</pre></div></li>
</ol>

<h4><a id="add-the-postgresql-driver-configuration-to-the-jboss-server" class="anchor" href="#add-the-postgresql-driver-configuration-to-the-jboss-server"><span class="anchor-icon"></span></a>Add the PostgreSQL Driver Configuration to the JBoss server</h4>

<p>You can configure the driver by running the <code>configure-postgresql.cli</code> script provided in the root directory of the quickstarts, by using the JBoss CLI interactively, or by manually editing the configuration file.</p>

<p><em>NOTE - Before you begin:</em></p>

<ol>
<li>If it is running, stop the JBoss EAP server.</li>
<li>Backup the file: <code>JBOSS_HOME/standalone/configuration/standalone-full.xml</code></li>
<li>After you have completed testing the quickstarts, you can replace this file to restore the server to its original configuration.</li>
</ol>

<h5><a id="configure-the-driver-by-running-the-jboss-cli-script" class="anchor" href="#configure-the-driver-by-running-the-jboss-cli-script"><span class="anchor-icon"></span></a>Configure the Driver By Running the JBoss CLI Script</h5>

<ol>
<li><p>Start the JBoss EAP server by typing the following: </p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="o">:</span>  <span class="n">JBOSS_HOME_SERVER_1</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
<span class="n">For</span> <span class="n">Windows</span><span class="o">:</span>  <span class="n">JBOSS_HOME_SERVER_1</span><span class="err">\</span><span class="n">bin</span><span class="err">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
</pre></div></li>
<li><p>Open a new command line, navigate to the root directory of the quickstarts, and run the following command, replacing JBOSS_HOME with the path to your server:</p>
<div class="highlight"><pre><span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">jboss</span><span class="o">-</span><span class="n">cli</span><span class="p">.</span><span class="n">sh</span> <span class="o">--</span><span class="n">connect</span> <span class="o">--</span><span class="n">file</span><span class="o">=</span><span class="n">configure</span><span class="o">-</span><span class="n">postgresql</span><span class="p">.</span><span class="n">cli</span> 
</pre></div>
<p>This script adds the PostgreSQL driver to the datasources subsystem in the server configuration. You should see the following result when you run the script:</p>
<div class="highlight"><pre><span class="cp">#1 /subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-module-name=org.postgresql,driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)</span>
<span class="n">The</span> <span class="n">batch</span> <span class="n">executed</span> <span class="n">successfully</span><span class="p">.</span>
<span class="p">{</span><span class="s">&quot;outcome&quot;</span> <span class="o">=&gt;</span> <span class="s">&quot;success&quot;</span><span class="p">}</span>
</pre></div></li>
</ol>

<h5><a id="configure-the-driver-using-the-jboss-cli-interactively" class="anchor" href="#configure-the-driver-using-the-jboss-cli-interactively"><span class="anchor-icon"></span></a>Configure the Driver Using the JBoss CLI Interactively</h5>

<ol>
<li><p>Start the JBoss EAP server by typing the following: </p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="o">:</span>  <span class="n">JBOSS_HOME_SERVER_1</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
<span class="n">For</span> <span class="n">Windows</span><span class="o">:</span>  <span class="n">JBOSS_HOME_SERVER_1</span><span class="err">\</span><span class="n">bin</span><span class="err">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
</pre></div></li>
<li><p>To start the JBoss CLI tool, open a new command line, navigate to the JBOSS_HOME directory, and type the following:</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="o">:</span> <span class="n">bin</span><span class="o">/</span><span class="n">jboss</span><span class="o">-</span><span class="n">cli</span><span class="p">.</span><span class="n">sh</span> <span class="o">--</span><span class="n">connect</span>
<span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">bin</span><span class="err">\</span><span class="n">jboss</span><span class="o">-</span><span class="n">cli</span><span class="p">.</span><span class="n">bat</span> <span class="o">--</span><span class="n">connect</span>
</pre></div></li>
<li><p>At the prompt, type the following:</p>
<div class="highlight"><pre><span class="p">[</span><span class="n">standalone</span><span class="err">@</span><span class="n">localhost</span><span class="o">:</span><span class="mi">9999</span> <span class="o">/</span><span class="p">]</span> <span class="o">/</span><span class="n">subsystem</span><span class="o">=</span><span class="n">datasources</span><span class="o">/</span><span class="n">jdbc</span><span class="o">-</span><span class="n">driver</span><span class="o">=</span><span class="n">postgresql</span><span class="o">:</span><span class="n">add</span><span class="p">(</span><span class="n">driver</span><span class="o">-</span><span class="n">name</span><span class="o">=</span><span class="n">postgresql</span><span class="p">,</span><span class="n">driver</span><span class="o">-</span><span class="n">module</span><span class="o">-</span><span class="n">name</span><span class="o">=</span><span class="n">org</span><span class="p">.</span><span class="n">postgresql</span><span class="p">,</span><span class="n">driver</span><span class="o">-</span><span class="n">xa</span><span class="o">-</span><span class="n">datasource</span><span class="o">-</span><span class="n">class</span><span class="o">-</span><span class="n">name</span><span class="o">=</span><span class="n">org</span><span class="p">.</span><span class="n">postgresql</span><span class="p">.</span><span class="n">xa</span><span class="p">.</span><span class="n">PGXADataSource</span><span class="p">)</span>
</pre></div></li>
<li><p>Tell the server to reload the configuration:</p>
<div class="highlight"><pre> <span class="p">[</span><span class="n">standalone</span><span class="err">@</span><span class="n">localhost</span><span class="o">:</span><span class="mi">9999</span> <span class="o">/</span><span class="p">]</span> <span class="o">:</span><span class="n">reload</span>
</pre></div></li>
</ol>

<h5><a id="configure-the-driver-by-manually-editing-the-configuration-file" class="anchor" href="#configure-the-driver-by-manually-editing-the-configuration-file"><span class="anchor-icon"></span></a>Configure the Driver By Manually Editing the Configuration File</h5>

<ol>
<li> If it is running, stop the JBoss EAP server.</li>
<li> Backup the file: <code>JBOSS_HOME/standalone/configuration/standalone-full.xml</code></li>
<li> Open the <code>JBOSS_HOME/standalone/configuration/standalone-full.xml</code> file in an editor and locate the subsystem <code>urn:jboss:domain:datasources:1.0</code>. </li>
<li><p>Add the following driver to the <code>&lt;drivers&gt;</code> section that subsystem. You may need to merge with other drivers in that section:</p>
<div class="highlight"><pre><span class="nt">&lt;driver</span> <span class="na">name=</span><span class="s">&quot;postgresql&quot;</span> <span class="na">module=</span><span class="s">&quot;org.postgresql&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;xa-datasource-class&gt;</span>org.postgresql.xa.PGXADataSource<span class="nt">&lt;/xa-datasource-class&gt;</span>
<span class="nt">&lt;/driver&gt;</span>
</pre></div></li>
</ol>

<h4><a id="remove-the-postgresql-configuration" class="anchor" href="#remove-the-postgresql-configuration"><span class="anchor-icon"></span></a>Remove the PostgreSQL Configuration</h4>

<hr/>

<p>When you are done testing the quickstarts, you can remove the PostgreSQL configuration by running the  <code>remove-postgresql.cli</code> script provided in the root directory of the quickstarts or by manually restoring the back-up copy the configuration file. </p>

<h5><a id="remove-the-postgresql-configuration-by-running-the-jboss-cli-script" class="anchor" href="#remove-the-postgresql-configuration-by-running-the-jboss-cli-script"><span class="anchor-icon"></span></a>Remove the PostgreSQL Configuration by Running the JBoss CLI Script</h5>

<ol>
<li><p>Start the JBoss EAP server by typing the following: </p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="o">:</span>  <span class="n">JBOSS_HOME_SERVER_1</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
<span class="n">For</span> <span class="n">Windows</span><span class="o">:</span>  <span class="n">JBOSS_HOME_SERVER_1</span><span class="err">\</span><span class="n">bin</span><span class="err">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span> <span class="o">-</span><span class="n">c</span> <span class="n">standalone</span><span class="o">-</span><span class="n">full</span><span class="p">.</span><span class="n">xml</span>
</pre></div></li>
<li><p>Open a new command line, navigate to the root directory of this quickstart, and run the following command, replacing JBOSS_HOME with the path to your server:</p>
<div class="highlight"><pre><span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">jboss</span><span class="o">-</span><span class="n">cli</span><span class="p">.</span><span class="n">sh</span> <span class="o">--</span><span class="n">connect</span> <span class="o">--</span><span class="n">file</span><span class="o">=</span><span class="n">remove</span><span class="o">-</span><span class="n">postgresql</span><span class="p">.</span><span class="n">cli</span> 
</pre></div>
<p>This script removes PostgreSQL from the <code>datasources</code> subsystem in the server configuration. You should see the following result when you run the script:</p>
<div class="highlight"><pre><span class="cp">#1 /subsystem=datasources/jdbc-driver=postgresql:remove</span>
<span class="n">The</span> <span class="n">batch</span> <span class="n">executed</span> <span class="n">successfully</span><span class="p">.</span>
<span class="p">{</span><span class="s">&quot;outcome&quot;</span> <span class="o">=&gt;</span> <span class="s">&quot;success&quot;</span><span class="p">}</span>
</pre></div></li>
</ol>

<h5><a id="remove-the-postgresql-configuration-manually" class="anchor" href="#remove-the-postgresql-configuration-manually"><span class="anchor-icon"></span></a>Remove the PostgreSQL Configuration Manually</h5>

<ol>
<li>If it is running, stop the JBoss EAP server.</li>
<li>Replace the <code>JBOSS_HOME/standalone/configuration/standalone-full.xml</code> file with the back-up copy of the file.</li>
</ol>

<h4><a id="important-quickstart-testing-information" class="anchor" href="#important-quickstart-testing-information"><span class="anchor-icon"></span></a>Important Quickstart Testing Information</h4>

<p>The installation of PostgreSQL is a one time procedure. However, unless you have set up the database to automatically start as a service, you must repeat the instructions &ldquo;Start the database server&rdquo; above for your operating system every time you reboot your machine.</p>

<h3><a id="install-and-configure-byteman" class="anchor" href="#install-and-configure-byteman"><span class="anchor-icon"></span></a>Install and Configure Byteman</h3>

<p><em>Byteman</em> is used by a few of the quickstarts to demonstrate distributed transaction processing and crash recovery.</p>

<h4><a id="what-is-it" class="anchor" href="#what-is-it"><span class="anchor-icon"></span></a>What is It?</h4>

<p><em>Byteman</em> is a tool which simplifies tracing and testing of Java programs. Byteman allows you to insert extra Java code into your application, either as it is loaded during JVM startup or after it has already started running. This code can be used to trace what the application is doing and to monitor and debug deployments to be sure it is operating correctly. You can also use <em>Byteman</em> to inject faults or synchronization code when testing your application. A few of the quickstarts use <em>Byteman</em> to halt an application server in the middle of a distributed transaction to demonstrate crash recovery.</p>

<h4><a id="download-and-configure-byteman" class="anchor" href="#download-and-configure-byteman"><span class="anchor-icon"></span></a>Download and Configure Byteman</h4>

<ol>
<li>Download Byteman from <a href="http://www.jboss.org/byteman/downloads/">http://www.jboss.org/byteman/downloads/</a></li>
<li>Extract the ZIP file to a directory of your choice.</li>
<li><p>By default, the Byteman download provides unrestricted permissions to <em>others</em> which can cause a problem when running Ruby commands for the OpenShift quickstarts. To restrict the permissions to <em>others</em>, open a command line and type the followinge:</p>
<div class="highlight"><pre><span class="n">cd</span> <span class="n">byteman</span><span class="o">-</span><span class="n">download</span><span class="o">-</span><span class="mf">2.0.0</span><span class="o">/</span>
<span class="n">chmod</span> <span class="o">-</span><span class="n">R</span> <span class="n">o</span><span class="o">-</span><span class="n">rwx</span> <span class="n">byteman</span><span class="o">-</span><span class="n">download</span><span class="o">-</span><span class="mf">2.0.0</span><span class="o">/</span>
</pre></div></li>
</ol>

<h4><a id="halt-the-application-using-byteman" class="anchor" href="#halt-the-application-using-byteman"><span class="anchor-icon"></span></a>Halt the Application Using Byteman</h4>

<p><em>NOTE</em>: The Byteman scripts only work in JTA mode. They do not work in JTS mode. If you have configured the server for a JTS quickstart, you must follow the instructions to <a href="jts/README.html#remove-the-jts-configuration-from-the-jboss-server">Remove the JTS Configuration from the JBoss server</a> before making the following changes. Otherwise Byteman will not halt the server. </p>

<p>When instructed to use Byteman to halt the application, perform the following steps:</p>

<ol>
<li><p>Find the appropriate configuration file for your operating system in the list below.</p>
<div class="highlight"><pre><span class="n">For</span> <span class="n">Linux</span><span class="o">:</span> <span class="n">JBOSS_HOME</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">conf</span> 
<span class="n">For</span> <span class="n">Windows</span><span class="o">:</span> <span class="n">JBOSS_HOME</span><span class="err">\</span><span class="n">bin</span><span class="err">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">conf</span><span class="p">.</span><span class="n">bat</span>
</pre></div></li>
<li><p><strong>Important</strong>: Make a backup copy of this file before making any modifications.</p></li>
<li><p>The quickstart README should specify the text you need to append to the server configuration file.</p></li>
<li><p>Open the configuration file and append the text specified by the quickstart to the end of the file. Make sure to replace the file paths with the correct location of your quickstarts and the <em>Byteman</em> download. </p></li>
<li><p>The following is an example of of the configuration changes needed for the <em>jta-crash-rec</em> quickstart: </p>

<p>For Linux, open the <code>JBOSS_HOME/bin/standalone.conf</code> file and append the following line:</p>
<div class="highlight"><pre>JAVA_OPTS=&quot;-javaagent:/PATH_TO_BYTEMAN_DOWNLOAD/lib/byteman.jar=script:/PATH_TO_QUICKSTARTS/jta-crash-rec/src/main/scripts/xa.btm <span class="cp">${</span><span class="n">JAVA_OPTS</span><span class="cp">}</span>&quot; 
</pre></div>
<p>For Windows, open the <code>JBOSS_HOME\bin\standalone.conf.bat</code> file and append the following line:</p>
<div class="highlight"><pre><span class="n">SET</span> <span class="s">&quot;JAVA_OPTS=%JAVA_OPTS% -javaagent:C:PATH_TO_BYTEMAN_DOWNLOAD\lib</span><span class="se">\b</span><span class="s">yteman.jar=script:C:\PATH_TO_QUICKSTARTS\jta-crash-rec\src\main\scripts\xa.btm %JAVA_OPTS%&quot;</span>
</pre></div></li>
</ol>

<h4><a id="disable-the-byteman-script" class="anchor" href="#disable-the-byteman-script"><span class="anchor-icon"></span></a>Disable the Byteman Script</h4>

<p>When you are done testing the quickstart, remember to restore the configuration file with the backup copy you made in step 2 above.</p>
</body></html>
